inherited sprAgents: TsprAgents
  HelpContext = 1158
  Caption = #1040#1075#1077#1085#1090#1099
  PixelsPerInch = 96
  TextHeight = 13
  inherited Panel2: TPanel
    Top = 69
    Height = 485
    inherited PageControl1: TPageControl
      Height = 485
      ActivePage = tsForm
      inherited tsTab: TTabSheet
        inherited GroupBox3: TGroupBox
          Height = 457
          inherited dbgRefer: TDBGridEh
            Height = 440
            Columns = <
              item
                EditButtons = <>
                FieldName = 'ID'
                Footers = <>
              end
              item
                EditButtons = <>
                FieldName = 'AGENT_NAME'
                Footers = <>
                Width = 191
              end
              item
                EditButtons = <>
                FieldName = 'AGENT_RATE'
                Footers = <>
                Width = 84
              end
              item
                EditButtons = <>
                FieldName = 'OPER_RATE'
                Footers = <>
                Width = 85
              end
              item
                EditButtons = <>
                FieldName = 'CODE'
                Footers = <>
                Width = 109
              end
              item
                EditButtons = <>
                FieldName = 'SUPERAGENT'
                Footers = <>
                Visible = False
                Width = 87
              end
              item
                EditButtons = <>
                FieldName = 'ORGCODE'
                Footers = <>
                Visible = False
              end
              item
                EditButtons = <>
                FieldName = 'STR_AGENT'
                Footers = <>
                Width = 82
              end
              item
                EditButtons = <>
                FieldName = 'ORGNAME'
                Footers = <>
                Width = 124
              end>
          end
        end
      end
      inherited tsForm: TTabSheet
        inherited GroupBox2: TGroupBox
          Top = 0
          Width = 784
          Height = 457
          Align = alClient
          object Label1: TLabel [0]
            Left = 108
            Top = 140
            Width = 17
            Height = 13
            Alignment = taRightJustify
            Caption = #1048#1044
          end
          object Label2: TLabel [1]
            Left = 75
            Top = 40
            Width = 50
            Height = 13
            Alignment = taRightJustify
            Caption = #1053#1072#1079#1074#1072#1085#1080#1077
          end
          object Label3: TLabel [2]
            Left = 34
            Top = 60
            Width = 91
            Height = 13
            Alignment = taRightJustify
            Caption = #1040#1075#1077#1085#1090#1089#1082#1072#1103' '#1089#1090#1072#1074#1082#1072
          end
          object Label4: TLabel [3]
            Left = 15
            Top = 80
            Width = 112
            Height = 13
            Alignment = taRightJustify
            Caption = #1054#1087#1077#1088#1072#1094#1080#1086#1085#1085#1072#1103' '#1089#1090#1072#1074#1082#1072
          end
          object Label5: TLabel [4]
            Left = 37
            Top = 100
            Width = 88
            Height = 13
            Alignment = taRightJustify
            Caption = #1050#1086#1076' '#1072#1075#1077#1085#1090#1072'('#1091#1085#1080#1082'.)'
          end
          object Label6: TLabel [5]
            Left = 79
            Top = 120
            Width = 46
            Height = 13
            Hint = #1082#1086#1076' '#1076#1083#1103' '#1074#1085#1077#1096#1085#1080#1093' '#1082#1083#1102#1095#1077#1081
            Alignment = taRightJustify
            Caption = #1055#1088#1077#1092#1080#1082#1089
          end
          object Label8: TLabel [6]
            Left = 9
            Top = 20
            Width = 116
            Height = 13
            Alignment = taRightJustify
            Caption = #1057#1074#1103#1079#1100' '#1089' '#1087#1088#1077#1076#1087#1088#1080#1103#1090#1080#1077#1084
          end
          inherited pnlButtons: TPanel
            Top = 424
            Width = 780
            TabOrder = 7
            inherited SpeedButton1: TSpeedButton
              Left = 584
            end
            inherited SpeedButton2: TSpeedButton
              Left = 684
            end
          end
          object DBEditEh1: TDBEditEh
            Left = 132
            Top = 137
            Width = 57
            Height = 19
            AlwaysShowBorder = True
            Color = clInactiveCaptionText
            DataField = 'ID'
            DataSource = dscRefer
            EditButtons = <>
            Enabled = False
            Flat = True
            ReadOnly = True
            TabOrder = 6
            Visible = True
          end
          object DBEditEh4: TDBEditEh
            Left = 132
            Top = 77
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'OPER_RATE'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 3
            Visible = True
          end
          object DBEditEh5: TDBEditEh
            Left = 132
            Top = 97
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'CODE'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 4
            Visible = True
          end
          object DBEditEh6: TDBEditEh
            Left = 132
            Top = 117
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'STR_AGENT'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 5
            Visible = True
          end
          object DBEditEh2: TDBEditEh
            Left = 132
            Top = 37
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'AGENT_NAME'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 1
            Visible = True
          end
          object DBEditEh3: TDBEditEh
            Left = 132
            Top = 57
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'AGENT_RATE'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 2
            Visible = True
          end
          object lcbOrg: TDBLookupComboboxEh
            Left = 132
            Top = 17
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'ORGCODE'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            KeyField = 'ID'
            ListField = 'NAME'
            ListSource = dscOrgs
            TabOrder = 0
            Visible = True
            OnExit = lcbOrgExit
          end
        end
      end
    end
  end
  inherited GroupBox1: TGroupBox
    Height = 44
    object Label10: TLabel
      Left = 20
      Top = 18
      Width = 50
      Height = 13
      Caption = #1053#1072#1079#1074#1072#1085#1080#1077
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object eNameSearch: TEdit
      Left = 76
      Top = 14
      Width = 149
      Height = 21
      BevelInner = bvSpace
      BevelKind = bkFlat
      BorderStyle = bsNone
      Ctl3D = True
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentCtl3D = False
      ParentFont = False
      TabOrder = 0
      OnChange = eNameSearchChange
    end
  end
  inherited dsRefer: TpFIBDataSet
    UpdateSQL.Strings = (
      'UPDATE AGENTS'
      'SET '
      '    AGENT_NAME = :AGENT_NAME,'
      '    AGENT_RATE = :AGENT_RATE,'
      '    OPER_RATE = :OPER_RATE,'
      '    CODE = :CODE,'
      '    SUPERAGENT = :SUPERAGENT,'
      '    ORGCODE = :ORGCODE,'
      '    STR_AGENT = :STR_AGENT'
      'WHERE'
      '    ID = :OLD_ID'
      '    ')
    DeleteSQL.Strings = (
      'DELETE FROM'
      '    AGENTS'
      'WHERE'
      '        ID = :OLD_ID'
      '    ')
    InsertSQL.Strings = (
      'INSERT INTO AGENTS('
      '    AGENT_NAME,'
      '    AGENT_RATE,'
      '    OPER_RATE,'
      '    CODE,'
      '    SUPERAGENT,'
      '    ORGCODE,'
      '    STR_AGENT'
      ')'
      'VALUES('
      '    :AGENT_NAME,'
      '    :AGENT_RATE,'
      '    :OPER_RATE,'
      '    :CODE,'
      '    :SUPERAGENT,'
      '    :ORGCODE,'
      '    :STR_AGENT'
      ')')
    RefreshSQL.Strings = (
      'select * from agents a'
      '@where_str'
      ' WHERE '
      '        A.ID = :OLD_ID'
      '    ')
    SelectSQL.Strings = (
      'select a.*, uo.name as orgname from agents a'
      '  left join userorg uo on uo.id = a.orgcode'
      'where 1 = 1')
    BeforeEdit = dsReferBeforeEdit
    BeforeInsert = dsReferBeforeInsert
    UpdateTransaction = trRefer
    object dsReferID: TFIBIntegerField
      DisplayLabel = #1048#1044
      FieldName = 'ID'
    end
    object dsReferAGENT_NAME: TFIBStringField
      DisplayLabel = #1053#1072#1079#1074#1072#1085#1080#1077' '#1072#1075#1077#1085#1090#1072
      FieldName = 'AGENT_NAME'
      Size = 120
      EmptyStrToNull = True
    end
    object dsReferAGENT_RATE: TFIBBCDField
      DisplayLabel = #1040#1075#1077#1085#1090#1089#1082#1072#1103' '#1089#1090#1072#1074#1082#1072
      FieldName = 'AGENT_RATE'
      Size = 3
      RoundByScale = True
    end
    object dsReferOPER_RATE: TFIBBCDField
      DisplayLabel = #1054#1087#1077#1088#1072#1094#1080#1086#1085#1085#1072#1103' '#1089#1090#1072#1074#1082#1072
      FieldName = 'OPER_RATE'
      Size = 3
      RoundByScale = True
    end
    object dsReferCODE: TFIBIntegerField
      DisplayLabel = #1050#1086#1076' '#1072#1075#1077#1085#1090#1072'('#1091#1085#1080#1082'.)'
      FieldName = 'CODE'
    end
    object dsReferSUPERAGENT: TFIBIntegerField
      FieldName = 'SUPERAGENT'
      Visible = False
    end
    object dsReferORGNAME: TFIBStringField
      DisplayLabel = #1055#1088#1077#1076#1087#1088#1080#1103#1090#1080#1077
      FieldName = 'ORGNAME'
      Size = 60
      EmptyStrToNull = True
    end
    object dsReferORGCODE: TFIBIntegerField
      FieldName = 'ORGCODE'
      Visible = False
    end
    object dsReferSTR_AGENT: TFIBStringField
      DisplayLabel = #1055#1088#1077#1092#1080#1082#1089
      FieldName = 'STR_AGENT'
      Size = 16
      EmptyStrToNull = True
    end
  end
  inherited trLists: TpFIBTransaction
    Left = 546
    Top = 251
  end
  inherited PropStorage: TPropStorageEh
    Section = 'sprAgents'
    StoredProps.Strings = (
      '<P>.Height'
      '<P>.Left'
      '<P>.PixelsPerInch'
      '<P>.Top'
      '<P>.Width'
      
        'Panel2.PageControl1.tsTab.GroupBox3.dbgRefer.<P>.Columns.Columns' +
        'Index'
      
        'Panel2.PageControl1.tsTab.GroupBox3.dbgRefer.<P>.Columns.<ForAll' +
        'Items>.Width')
  end
  object dsOrgs: TpFIBDataSet
    SelectSQL.Strings = (
      'select id,name from userorg')
    Transaction = trLists
    Database = MAINDM.pMainDatabase
    Left = 480
    Top = 253
    object dsOrgsID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsOrgsNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object dscOrgs: TDataSource
    DataSet = dsOrgs
    Left = 480
    Top = 305
  end
end
